An entity in a render queue. It drives the shader and possible graph position for a set of renderables (SubEntity).
More...
An entity in a render queue. It drives the shader and possible graph position for a set of renderables (SubEntity).
It is possible to create one by calling RenderQueue::addEntity().
Adding it to a graph can be done by setting its parent node through setParentNode().
◆ getParentNode()
Node* nkGraphics::Entity::getParentNode |
( |
| ) |
const |
◆ getShader()
Shader* nkGraphics::Entity::getShader |
( |
| ) |
const |
◆ getRaytracingShader()
Shader* nkGraphics::Entity::getRaytracingShader |
( |
| ) |
const |
- Returns
- The raytracing shader used, when in a raytraced queue used in a RaytracingPass.
◆ getRenderQueue()
RenderQueue* nkGraphics::Entity::getRenderQueue |
( |
| ) |
const |
- Returns
- The parent render queue.
◆ setParentNode()
void nkGraphics::Entity::setParentNode |
( |
Node * |
parent | ) |
|
Sets the parent node of the entity. This will impact the transformation applied to the entity when painting it. At all times, an entity can be attached to one node.
- Parameters
-
parent | The node to get a transformation from. |
◆ setShader()
void nkGraphics::Entity::setShader |
( |
Shader * |
shade | ) |
|
◆ setRaytracingShader()
void nkGraphics::Entity::setRaytracingShader |
( |
Shader * |
shade | ) |
|
◆ isCompatibleWith()
bool nkGraphics::Entity::isCompatibleWith |
( |
Shader * |
shade | ) |
const |
Checks whether an entity is compatible with a shader. This takes into account the data available in renderables of the entity, and what the shader needs to be working.
- Returns
- Whether the entity will be compatible with a given shader.
◆ updateBasicShader()
void nkGraphics::Entity::updateBasicShader |
( |
SubEntity * |
caller | ) |
|
Updates the basic (built-in) shader attached to the entity. Used internally when adding new renderables to ensure a compatible shader is attached.
- Parameters
-
caller | The sub entity requesting an update. |
◆ getMesh()
Mesh* nkGraphics::Entity::getMesh |
( |
int |
index | ) |
const |
Shortcut to get a mesh from renderables inside.
- Parameters
-
index | The index of the renderable to retrieve the mesh from. |
- Returns
- The mesh requested from the renderable.
◆ addChild()
- Returns
- A newly created sub entity. The entity is responsible for the memory returned, external code should not free it. See removeChild().
◆ getChild()
SubEntity* nkGraphics::Entity::getChild |
( |
unsigned int |
index | ) |
const |
- Parameters
-
index | The index of the sub entity to retrieve. |
- Returns
- The child requested if available, nullptr else.
◆ getChildCount()
int nkGraphics::Entity::getChildCount |
( |
| ) |
|
- Returns
- The number of children sub entities available.
◆ getChildren()
const std::vector<SubEntity*>& nkGraphics::Entity::getChildren |
( |
| ) |
const |
- Returns
- The array of sub entities available in the entity.
◆ removeChild()
void nkGraphics::Entity::removeChild |
( |
unsigned int |
index | ) |
|
Removes and frees the memory attached to a sub entity.
- Parameters
-
index | The index of the sub entity to remove. |
◆ updateMeshBinding()
void nkGraphics::Entity::updateMeshBinding |
( |
SubEntity * |
caller, |
|
|
Mesh * |
oldMesh |
|
) |
| |
Updates the mesh bindings for a renderable sub entity. Used internally.
- Parameters
-
caller | The calling sub entity. |
oldMesh | The old mesh that was set before. |
◆ exportClassToTree()
virtual void nkGraphics::Entity::exportClassToTree |
( |
nkExport::Node * |
rootNode | ) |
|
|
overridevirtual |
Basic exporting capabilities.
- Parameters
-
rootNode | The tree to export to. |
Implements nkExport::Exportable.
◆ importClassFromTree()
virtual void nkGraphics::Entity::importClassFromTree |
( |
nkExport::Node * |
rootNode | ) |
|
|
overridevirtual |
Basic importing capabilities.
- Parameters
-
rootNode | The tree to import from. |
Implements nkExport::Exportable.
The documentation for this class was generated from the following file:
- Documentation/Headers/NilkinsGraphics/Graph/Entity.h